<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta charset="UTF-8">
	<title><?php if(isset($seo_title) && isset($site_title) && ($seo_title == $site_title)){?><?php echo isset($seo_title)?$seo_title:"";?><?php }else{?><?php echo isset($seo_title)?$seo_title:"";?>-<?php echo isset($site_title)?$site_title:"";?><?php }?></title>
	<meta name="description" content="<?php echo isset($seo_description)?$seo_description:"";?>">
	<meta name="Keywords" content="<?php echo isset($seo_keywords)?$seo_keywords:"";?>">
	<meta http-equiv="X-UA-Compatible" content="IE=Edge">
	<link href="<?php echo urldecode(Url::urlFormat("@static/images/favicon.png"));?>" rel="apple-touch-icon-precomposed">
	<link type="image/x-icon" href="<?php echo urldecode(Url::urlFormat("@favicon.ico"));?>" rel="icon">
	<link type="text/css" rel="stylesheet" href="<?php echo urldecode(Url::urlFormat("#css/common.css"));?>" />
		<!--[if IE 6]>
		<script src="<?php echo urldecode(Url::urlFormat("#js/DD_belatedPNG-min.js"));?>"></script>
		<script>DD_belatedPNG.fix('.ie6png');</script>
		<![endif]-->
		<script type="text/javascript">
			var server_url = '<?php echo urldecode(Url::urlFormat("@"));?>__con__/__act__';
			var Tiny = {user:{name:'<?php echo isset($user['name'])?$user['name']:'';?>',id:'<?php echo isset($user['id'])?$user['id']:0;?>',online:<?php echo isset($user['id']) && $user['id']?'true':'false';?>}};
		</script>
		<?php echo JS::import('jquery');?>
		<script type='text/javascript' src="<?php echo urldecode(Url::urlFormat("#js/common.js"));?>"></script>
		<!--S 一个页面只引入一次即可-->
		<link rel="stylesheet" type="text/css" href="<?php echo urldecode(Url::urlFormat("#js/jslider.css"));?>" />
		<script type='text/javascript' src="<?php echo urldecode(Url::urlFormat("#js/jslider.js"));?>"></script>
		<!--E 只引入一次-->

	</head>
	<body>
		<script type="text/javascript">if(screen.width < 1200) { document.getElementsByTagName('body')[0].className = 'screen_960'; }</script>

		<!--S 头部 -->
		<div id="header" class="clearfix">
			<div class="header-bar">
				<div class="wrap nav">
					<ul class=" fr">
						<?php if($user){?>
						<li>你好<b><?php echo isset($user['name'])?$user['name']:"";?></b> [<a href="<?php echo urldecode(Url::urlFormat("/simple/logout"));?>">安全退出</a>]，<?php echo isset($site_name)?$site_name:"";?>！</li>
						<li><a href="<?php echo urldecode(Url::urlFormat("/ucenter/order"));?>">我的订单</a></li>
						<?php }else{?>
						<li><a href="<?php echo urldecode(Url::urlFormat("/simple/login"));?>"><b>登录</b></a></li>
						<li><a href="<?php echo urldecode(Url::urlFormat("/simple/reg"));?>">注册</a></li>
						<?php }?>
						<li><a href="<?php echo urldecode(Url::urlFormat("/index/help_index"));?>">帮助中心</a></li>
					</ul>
				</div>
			</div>
			<div class="header-main">
				<div class="wrap">
					<div class="logo "><a href="<?php echo urldecode(Url::urlFormat("/index/index"));?>"><img class="ie6png" src="<?php echo urldecode(Url::urlFormat("@$site_logo"));?>" style="max-height:74px;"></a></div>
					<div class="header-search fl">
						<form id="search-form" action="<?php echo urldecode(Url::urlFormat("/"));?>" method="get">
							<input type="hidden" name="con" value="index">
							<input type="hidden" name="act" value="search">
							<input type='hidden' name='tiny_token_' value='<?php echo Tiny::app()->getToken("");?>'/>
							<input id="search-keyword" class="txt-keyword" name="keyword" value="<?php echo isset($keyword)?$keyword:"";?>" type="text"><button type="submit" class="btn-search fl"><b>搜 索</b></button>
						</form>
						<p id="tags-list"><b>热门标签：</b><?php $item=null; $query = new Query("tags");$query->order = "is_hot desc,sort desc,num desc";$query->limit = "6";$items = $query->find(); foreach($items as $key => $item){?><a href="#"><?php echo isset($item['name'])?$item['name']:"";?></a><?php }?></p>
					</div>
					<div class="header-cart">
						<dl class="fr">
							<dt ><i class="icon-member ie6png vm"></i><a class="vm" href="<?php echo urldecode(Url::urlFormat("/ucenter/index"));?>">我的商城</a><s class="b-triangle"></s></dt>
							<dd class="cart-list">
								<?php $sidebar_nav = array('我的订单'=>'order', '我的关注'=>'attention', '商品咨询'=>'consult', '商品评价'=>'review', '我的消息'=>'message', '收货地址'=>'address', '我的优惠券'=>'voucher', '账户金额'=>'account');?>
								<ul>
									<?php foreach($sidebar_nav as $key => $item){?>
									<li><a href="<?php echo urldecode(Url::urlFormat("/ucenter/$item"));?>"><?php echo isset($key)?$key:"";?></a></li>
									<?php }?>
								</ul>
							</dd>
						</dl>
					</div>
				</div>
			</div>
			<div class="header-nav" id="float">
				<div class="wrap">
					<ul class="nav">
						<li><a href="<?php echo urldecode(Url::urlFormat("/index/index"));?>">首页</a></li>
						<?php $item=null; $query = new Query("nav");$query->where = "type = 'main' and enable = 1";$query->order = "`sort` desc";$items = $query->find(); foreach($items as $key => $item){?>
						<li><a href="<?php if(strstr($item['link'],'http://')===false){?><?php echo urldecode(Url::urlFormat("$item[link]"));?><?php }else{?><?php echo isset($item['link'])?$item['link']:"";?><?php }?>" target="<?php if($item['open_type']==1){?>_blank<?php }else{?>_self<?php }?>"><?php echo isset($item['name'])?$item['name']:"";?></a></li>
						<?php }?>
					</ul>
					<div class="category">
						<h3 ><a href="#" ><i class="icon-list ie6png vm"></i>全部商品分类<s class="b-triangle vm"></s></a></h3>
						<div style="height: 410px;" class="group clearfix">
						<?php $current_category_ids='';$parent_category='';?>
							<?php foreach($category as $key => $categ){?>
							<dl>
								<dt>
									<h4><a href="<?php echo urldecode(Url::urlFormat("/index/category/cid/$categ[id]"));?>">
									<?php if(isset($categ['id'])){?>
                                    <?php $current_category_ids=$categ['id'].',';$parent_category=$categ['id'];?>
                                    <?php }?> <?php echo isset($categ['title'])?$categ['title']:"";?></a></h4>
								</dt>
								<dd>
									<ul class="sub">
										<?php foreach($categ['child'] as $key => $child){?>
										<li>
											<h5><a href="<?php echo urldecode(Url::urlFormat("/index/category/cid/$child[id]"));?>">
											<?php if(isset($child['id'])){?>
                                            <?php $current_category_ids.=$child['id'].',';?>
                                            <?php }?>
											<?php echo isset($child['title'])?$child['title']:"";?></a></h5>
											<p>
												<?php if(isset($child['child'])){?>
												<?php foreach($child['child'] as $key => $grandson){?>
												<a href="<?php echo urldecode(Url::urlFormat("/index/category/cid/$grandson[id]"));?>">
												<?php if(isset($grandson['id'])){?>
                                                <?php $current_category_ids.=$grandson['id'].',';?><?php }?>
												<?php echo isset($grandson['title'])?$grandson['title']:"";?></a>
												<?php }?>
												<?php }?>
											</p>
										</li>
										<?php }?>
									</ul>
									<ul class="brand">
                                        <li>推荐品牌</li>
                                        <li>
                                        <?php $current_category_ids = trim($current_category_ids,',');?>
                                        <?php $item=null; $query = new Query("goods as go");$query->fields = "br.name,br.id";$query->join = "left join brand as br on go.brand_id = br.id";$query->where = "go.category_id in($current_category_ids)";$query->group = "go.brand_id";$query->cache = "true";$items = $query->find(); foreach($items as $key => $item){?>
                                        <?php if($item['name']!=''){?>
                                        <span><a href="<?php echo urldecode(Url::urlFormat("/index/category/cid/$parent_category/sort/0/brand/$item[id]"));?>"><?php echo isset($item['name'])?$item['name']:"";?></a></span>
                                        <?php }?>
                                        <?php }?>
                                        </li>
                                    </ul>
								</dd>
							</dl>
							<?php }?>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!--E 头部 -->
		<!--S content-->
		<div id="content">
			<div class="wrap">
				<div class="mt20 box p20">
	<div class="fl" style="width:50%">
		<div class="p20 tc">
			<h1 style="font-size:10em;color:#7c0000;">4 0 4</h1>
			<p style="font-size:2em;color:#666;">很抱歉，我要访问的页面不存在。</p>
		</div>
	</div>
	<div class="fr" style="width:50%">
		<div class="p20" style="border-left:#ccc 1px solid;height:220px;">
			<h1 style="font-size:2em;">您可以：</h1>
			<ul class="p20">
				<li class="p10">检查输入的地址是否正确，然后输入正确的地址信息。</li>
				<li class="p10">直接去： <a href="<?php echo urldecode(Url::urlFormat("@"));?>" class="p10">商城首页</a> <a href="<?php echo urldecode(Url::urlFormat("/ucenter"));?>" class="p10">我的商城</a> <a href="<?php echo urldecode(Url::urlFormat("/simple/cart"));?>" class="p10">我的购物车</a></li>
				<li class="p10"><span id="time" class="red"></span><span>后 将返回<b class="red">商城首页</b>，请稍后...</span></li>
			</ul>
			<div>
				
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
$("#time").countdown({end_time:"<?php echo date('Y/m/d H:i:s',strtotime('+10 second',time()));?>",format:'{s}秒',callback:function(){
		location.href="<?php echo urldecode(Url::urlFormat("@"));?>";
}});
</script>

			</div>
		</div>
		<!--E content-->
		<!--S 底部 -->
		<div id="footer" class="mt20  ">
			<div class="wrap">
				<div class="footer-main clearfix">
					<?php $item=null; $query = new Query("help_category");$query->order = "sort desc";$query->limit = "5";$items = $query->find(); foreach($items as $key => $item){?>
					<dl >
						<dt class="clearfix"><span class="icon-<?php echo isset($item['alias'])?$item['alias']:"";?> fl"></span><a href="javascript:;"><?php echo isset($item['name'])?$item['name']:"";?></a></dt>
						<?php $help=null; $query = new Query("help");$query->where = "category_id = $item[id]";$query->item = "$help";$query->cache = "true";$query->cacheTime = "1200";$items = $query->find(); foreach($items as $key => $help){?>
						<dd><a href="<?php echo urldecode(Url::urlFormat("/index/help/id/$help[id]"));?>"><?php echo isset($help['title'])?$help['title']:"";?></a></dd>
						<?php }?>
					</dl>
					<?php }?>
				</div>
				<div class="footer-links">
					<p><a><b>友情连接：</b></a><a href="http://www.tinyrise.com">济南泰创软件科技有限公司</a></p>
				</div>
				<div class="copyright">
					<div><?php $item=null; $query = new Query("nav");$query->where = "type = 'bottom'";$query->order = "`sort` desc";$items = $query->find(); foreach($items as $key => $item){?>
					<a href="<?php if(strstr($item['link'],'http://')===false){?><?php echo urldecode(Url::urlFormat("$item[link]"));?><?php }else{?><?php echo isset($item['link'])?$item['link']:"";?><?php }?>" target="<?php if($item['open_type']==1){?>_blank<?php }else{?>_self<?php }?>"><?php echo isset($item['name'])?$item['name']:"";?></a>
					<?php }?></div>
					<!--S 济南泰创软件科技有限公司保留所有版权，非授权用户严禁删除版权信息；擅自删除，后果自负，您的支持是我们成长的动力。-->
					<div><span>Powered by <a href="http://www.tinyrise.com"><b style="color: #7c0000">Tiny</b><b style="color: #666">Shop</b></a></span> © 2014 <a href="http://www.tinyrise.com">tinyrise.com</a> . 保留所有权利 。<?php echo isset($site_icp)?$site_icp:"";?> </div>
					<!--S 济南泰创软件科技有限公司保留所有版权，非授权用户严禁删除版权信息；擅自删除，后果自负，您的支持是我们成长的动力。-->
				</div>
			</div>

		</div>
		<!--S 购物车 -->
		<div id="shopping-cart" >

			<div id="card-wrap" class="ie6png">
				<div class="clearfix" style="height: 32px;"><a href="<?php echo urldecode(Url::urlFormat("/simple/cart"));?>" class="fr btn btn-gray" style="padding: 2px 6px;font-size: 12px;" target="_blank">查看购物车</a></div>
				<div id="card-list">
					<?php $total=0.00;?>
					<?php foreach($cart as $key => $item){?>
					<?php $total += $item['amount'];?>
					<div class="card-item" id="<?php echo isset($item['id'])?$item['id']:"";?>">
						<div class="pic">
							<a class="card-pic" href="<?php echo urldecode(Url::urlFormat("/index/product/id/$item[goods_id]"));?>" target="_blank" title="<?php echo isset($item['name'])?$item['name']:"";?>"><img src="<?php echo urldecode(Url::urlFormat("@$item[img]"));?>" width="50" height="50"></a></div>
							<div class="spec">
								<?php foreach($item['spec'] as $key => $spec){?>
								<p title="<?php echo isset($spec['name'])?$spec['name']:"";?>:<?php echo isset($spec['value'][2])?$spec['value'][2]:"";?>"><?php echo isset($spec['value'][2])?$spec['value'][2]:"";?></p>
								<?php }?>
							</div>
							<div class="num"><?php echo isset($item['num'])?$item['num']:"";?></div>
							<div class="price" title="<?php echo isset($item['amount'])?$item['amount']:"";?>"><?php echo isset($item['amount'])?$item['amount']:"";?></div>
							<a class="icon-close ie6png" productid="<?php echo isset($item['id'])?$item['id']:"";?>"></a>
						</div>
						<?php }?>
					</div>
				</div>
				<div id="shopping-bar-box" >
					<div id="shopping-bar">
						<div class="fl tl" style="padding-left:8px;" > <i class="icon-cart ie6png" style="zoom:1;"></i><span style="zoom:1;">购物车(<b class="cart-product-num"><?php echo count($cart);?></b>)</span></div> 
						<span class="fr tr">
							<div style="padding-right:12px;"><span class="currency-symbol"><?php echo isset($currency_symbol)?$currency_symbol:"";?></span><b class="cart-total"><?php echo  sprintf("%01.2f",$total);?></b></div>
						</span>
					</div>
					<a id="settlement" href="<?php echo urldecode(Url::urlFormat("/simple/cart"));?>">去结算</a>
				</div>
			</div>
			<script type="text/javascript">
				$("#shopping-cart").on("mouseenter",function(){
					if($("#card-wrap").position().top>-15)$("#card-wrap").animate({top:"-15px"},100);
				});
				$("#shopping-cart").on("mouseleave",function(){
					if($("#card-wrap").position().top==-15)$("#card-wrap").animate({top:"-5px"},"fast");
				});
				$(document).on("click",function(e){
					$("#card-wrap").animate({top:"-5px"},"fast");
				})
				$("#shopping-cart").on("click",function(e){
					if (e.stopPropagation) {e.stopPropagation();}     
					e.cancelBubble = true;
				});
				$("#shopping-bar").on("click",function(e){
			//for(i in e)alert(i+'==='+e[i]);
			var currentNode = e.currentTarget;
			//alert(currentNode.id);
			//if (e.stopPropagation) {e.stopPropagation();}     
			//e.cancelBubble = true;
			if($("#card-wrap").outerHeight()>360)$("#card-wrap").css("height","360px");
			if($("#card-wrap").position().top>=-15)$("#card-wrap").animate({top:1-$("#card-wrap").outerHeight()},"fast");
			else{
				$("#card-wrap").animate({top:"-5px"},100);
			}
			return false;
		});

				function updateCart(data){
					var card_items = '';
					for(var i in data){
						var spec = data[i]['spec'];
						var spec_str = '';
						for(var k in spec){
							spec_str +="<p>"+spec[k]['value'][2]+"</p>";
						}
						card_items += '<div class="card-item" id="'+i+'"><div class="pic"><img src="<?php echo urldecode(Url::urlFormat("@"));?>'+data[i]['img']+'" width="50" height="50"></div><div class="spec">'+spec_str+'</div><div class="num">'+data[i]['num']+'</div><div class="price">'+(data[i]['amount'])+'</div><a class="icon-close ie6png" productid="'+data[i]['id']+'"></a></div>';
					}
					$("#card-list").empty().append(card_items);
					changeCartInfo();
					bindDelEvent();
				}
				bindDelEvent();
				function bindDelEvent(){
					$("#shopping-cart .icon-close").on("click",function(){
						var btn_close = $(this);
						$.post("<?php echo urldecode(Url::urlFormat("/index/cart_del"));?>",{id:btn_close.attr("productid")},function(){
							btn_close.parent().remove();
							changeCartInfo();
							$("#card-wrap").css({top:1-$("#card-wrap").outerHeight()},"fast");
						},"json");
					});
				}

				function changeCartInfo(){
					$(".cart-product-num").text($(".card-item").size());
					var total = 0.00;
					$(".card-item .price").each(function(){
						total += parseFloat($(this).text());
					});
					$(".cart-total").text(total.toFixed(2));
				}
				$("#tags-list a").each(function(){
					$(this).on("click",function(){
						$("#search-keyword").val($(this).text());
						$("#search-form").submit();
					})
				})
        //导航高亮
        $(".header-nav .nav li").has("a[href='<?php echo isset($url_index)?$url_index:"";?>']").addClass("current");
        //
        $(".header-cart dl,.category,.category .group dl").hover(
        	function () {
        		$(this).addClass("hover");
        	},
        	function () {
        		$(this).removeClass("hover");
        	}
        	);
        </script>
        <!--E 购物车 -->
        <!--E 底部 -->
    </body>
    </html>
<!--Powered by TinyRise-->